<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Gold Chit - Add Customer</title>
</head>
<body>

	<form:form method="post" modelAttribute="customerAttribute"
		action="addCustomer">
		<table width="100%" border="0" cellspacing="0" cellpadding="5">
			<tr>
				<td width="50%">
					<!-- Table on left side -->
					<table width="100%" border="0" cellspacing="0" cellpadding="1">
						<tr>
							<td colspan="3"><b>Customer Information</b></td>
						</tr>
						<tr>
							<td>Customer ID</td>
							<td><form:input path="customerId" /></td>
							<td><form:errors path="customerId"></form:errors></td>
						</tr>
						<tr>
							<td>Role</td>
							<td><form:input path="role" /></td>
							<td><form:errors path="role"></form:errors></td>
						</tr>
						<tr>
							<td>First Name</td>
							<td><form:input path="firstName" /></td>
							<td><form:errors path="firstName"></form:errors></td>
						</tr>
						<tr>
							<td>Last Name</td>
							<td><form:input path="lastName" /></td>
							<td><form:errors path="lastName"></form:errors></td>
						</tr>
						<tr>
							<td>Email ID</td>
							<td><form:input path="emailId" /></td>
							<td><form:errors path="emailId"></form:errors></td>
						</tr>
						<tr>
							<td>Mobile Number</td>
							<td><form:input path="mobileNumber" /></td>
							<td><form:errors path="mobileNumber"></form:errors></td>
						</tr>
						<tr>
							<td colspan="3"><b>Customer Address Details</b></td>
						</tr>
						<tr>
							<td>Address Line1</td>
							<td><form:input path="address.addressLineOne" /></td>
							<td><form:errors path="address.addressLineOne"></form:errors></td>
						</tr>
						<tr>
							<td>Address Line2</td>
							<td><form:input path="address.addressLineTwo" /></td>
							<td><form:errors path="address.addressLineTwo"></form:errors></td>
						</tr>
						<tr>
							<td>City</td>
							<td><form:input path="address.city" /></td>
							<td><form:errors path="address.city"></form:errors></td>
						</tr>
						<tr>
							<td>State</td>
							<td><form:input path="address.state" /></td>
							<td><form:errors path="address.state"></form:errors></td>
						</tr>
						<tr>
							<td>Country</td>
							<td><form:input path="address.country" /></td>
							<td><form:errors path="address.country"></form:errors></td>
						</tr>
						<tr>
							<td>Pincode</td>
							<td><form:input path="address.pincode" /></td>
							<td><form:errors path="address.pincode"></form:errors></td>
						</tr>
						<tr>
							<td colspan="3"><b>Customer Chit Details</b></td>
						</tr>
						<tr>
							<td>Customer Chits</td>
							<td><form:select path="customerChitSelected">
									<form:option value="0" label="select a chit"></form:option>
									<form:options items="${customerAttribute.customerChits}"
										itemValue="customerChitNumber" itemLabel="customerChitNumber"></form:options>
								</form:select></td>
							<td></td>
						</tr>
					</table> <!-- END -->
				</td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="Submit"></td>
			</tr>
			<tr>
				<td colspan="2"><c:if test="${addedCustomer != null}">
				Customer Registered Successfully
					</c:if></td>
			</tr>
		</table>
		<!-- END OF MAIN TABLE -->
	</form:form>
</body>
</body>
</html>